from app.fun import *
from app.myclass.bdfy import Bdfy
import time

class Wyc():
    def __init__(self):
        pass

    def toWyc(self,data,splstr="######"):
        try:
            temdata = filter_tags(data)

            # temdatas = temdata.split("\n")
            result = ''
            td1 = self.tofy(temdata)

            temdatas = temdata.split(splstr)
            for i in temdatas:
                result = result + outhtml(str(i))

            # for i in temdatas:
            #     if i:
            #         td1 = self.tofy(i)
            #         result = result+outhtml(str(td1))
            #         time.sleep(1)
            return result
        except Exception as e:
            print(e)
            return data


    def tofy(self,q):
        try:
            Bdfyobj = Bdfy()
            td1 = Bdfyobj.zhToen(q)
            time.sleep(1)
            td1 = Bdfyobj.enTozh(td1)
            return td1
        except Exception as e:
            print(e)
            return q

